home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / CIncludes / SocketServices.h < prev    next >
C/C++ Source or Header  |  1996-05-01  |  23KB  |  800 lines

  1. /*
  2.      File:        SocketServices.h
  3.  
  4.      Contains:    This file contains constants and data structures that
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18. #ifndef __SOCKETSERVICES__
  19. #define __SOCKETSERVICES__
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. #ifndef __MIXEDMODE__
  25. #include <MixedMode.h>
  26. #endif
  27.  
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31.  
  32. #if PRAGMA_IMPORT_SUPPORTED
  33. #pragma import on
  34. #endif
  35.  
  36. #if PRAGMA_ALIGN_SUPPORTED
  37. #pragma options align=mac68k
  38. #endif
  39.  
  40. #if FOR_SYSTEM7_ONLY
  41. /*
  42. ///////////////////////////////////////////////////////////////////////////////////////
  43.     TypeDefs for the Socket Services function codes
  44. */
  45. typedef Byte SS_BYTE;
  46. typedef Byte SS_FLAGS8;
  47. typedef Byte SS_IRQ;
  48. typedef Byte SS_PWRLEVEL;
  49. typedef UInt16 SS_ADAPTER;
  50. typedef UInt16 SS_BCD;
  51. typedef UInt16 SS_COUNT;
  52. typedef UInt16 SS_EDC;
  53. typedef UInt16 SS_FLAGS16;
  54. typedef UInt16 SS_PAGE;
  55. typedef UInt16 SS_PWRINDEX;
  56. typedef UInt16 SS_SIGNATURE;
  57. typedef UInt16 SS_SKTBITS;
  58. typedef UInt16 SS_SOCKET;
  59. typedef UInt16 SS_SPEED;
  60. typedef UInt16 SS_WINDOW;
  61. typedef UInt16 SS_WORD;
  62. typedef UInt32 SS_BASE;
  63. typedef UInt32 SS_FLAGS32;
  64. typedef UInt32 SS_OFFSET;
  65. typedef UInt32 SS_SIZE;
  66. typedef Ptr SS_PTR;
  67. typedef OSErr SS_RETCODE;
  68. struct SS_SCHARTBL {
  69.     UInt16                             sktCaps;                    /*    SS_FLAGS16*/
  70.     UInt32                             activeHigh;                    /*    SS_FLAGS32*/
  71.     UInt32                             activeLow;                    /*    SS_FLAGS32*/
  72. };
  73. typedef struct SS_SCHARTBL SS_SCHARTBL;
  74.  
  75. struct SS_SISTRUCT {
  76.     UInt16                             bufferLength;                /*    SS_WORD*/
  77.     UInt16                             dataLength;                    /*    SS_WORD*/
  78.     SS_SCHARTBL                     charTable;                    /*    SS_FLAGS16*/
  79. };
  80. typedef struct SS_SISTRUCT SS_SISTRUCT;
  81.  
  82.  
  83. enum {
  84.     STR_SIZE                    = 24
  85. };
  86.  
  87. /* minimum string length*/
  88. struct SS_VISTRUCT {
  89.     UInt16                             bufferLength;                /*    SS_WORD*/
  90.     UInt16                             dataLength;                    /*    SS_WORD*/
  91.     char                             szImplementor[1];            /*    SS_WORD*/
  92.     Byte                             padding[1];                    /*    */
  93. };
  94. typedef struct SS_VISTRUCT SS_VISTRUCT;
  95.  
  96. struct SS_ACHARTBL {
  97.     UInt16                             adpCaps;                    /*    SS_FLAGS16*/
  98.     UInt32                             activeHigh;                    /*    SS_FLAGS32*/
  99.     UInt32                             activeLow;                    /*    SS_FLAGS32*/
  100. };
  101. typedef struct SS_ACHARTBL SS_ACHARTBL;
  102.  
  103. struct SS_PWRENTRY {
  104.     Byte                             powerLevel;                    /*    SS_PWRLEVEL*/
  105.     Byte                             validSignals;                /*    SS_FLAGS8*/
  106. };
  107. typedef struct SS_PWRENTRY SS_PWRENTRY;
  108.  
  109. struct SS_AISTRUCT {
  110.     UInt16                             bufferLength;                /*    SS_WORD*/
  111.     UInt16                             dataLength;                    /*    SS_WORD*/
  112.     SS_ACHARTBL                     charTable;
  113.     UInt16                             numPwrEntries;                /*    SS_WORD*/
  114.     SS_PWRENTRY *                    pwrEntryPtr;
  115. };
  116. typedef struct SS_AISTRUCT SS_AISTRUCT;
  117.  
  118. struct SS_MEMWINTBL {
  119.     UInt16                             memWndCaps;                    /*    SS_FLAGS16*/
  120.     UInt32                             firstByte;                    /*    SS_BASE*/
  121.     UInt32                             lastByte;                    /*    SS_BASE*/
  122.     UInt32                             minSize;                    /*    SS_SIZE*/
  123.     UInt32                             maxSize;                    /*    SS_SIZE*/
  124.     UInt32                             reqGran;                    /*    SS_SIZE*/
  125.     UInt32                             reqBase;                    /*    SS_SIZE*/
  126.     UInt32                             reqOffset;                    /*    SS_SIZE*/
  127.     UInt16                             slowest;                    /*    SS_SPEED*/
  128.     UInt16                             fastest;                    /*    SS_SPEED*/
  129. };
  130. typedef struct SS_MEMWINTBL SS_MEMWINTBL;
  131.  
  132. struct SS_IOWINTBL {
  133.     UInt16                             ioWndCaps;                    /*    SS_FLAGS16*/
  134.     UInt32                             firstByte;                    /*    SS_BASE*/
  135.     UInt32                             lastByte;                    /*    SS_BASE*/
  136.     UInt32                             minSize;                    /*    SS_SIZE*/
  137.     UInt32                             maxSize;                    /*    SS_SIZE*/
  138.     UInt32                             reqGran;                    /*    SS_SIZE*/
  139.     UInt16                             addrLines;                    /*    SS_COUNT*/
  140.     Byte                             eisaSlot;                    /*    SS_FLAGS8*/
  141.     Byte                             padding[1];                    /*    */
  142. };
  143. typedef struct SS_IOWINTBL SS_IOWINTBL;
  144.  
  145. struct SS_WISTRUCT {
  146.     UInt16                             bufferLength;                /*    SS_WORD*/
  147.     UInt16                             dataLength;                    /*    SS_WORD*/
  148.     UInt16                             numTblEntries;                /*    SS_WORD*/
  149.     SS_MEMWINTBL                     memWinTbl;
  150.     SS_IOWINTBL                     ioWinTbl;
  151. };
  152. typedef struct SS_WISTRUCT SS_WISTRUCT;
  153.  
  154. /*
  155. ------------------------------------------------------------------------------------------------------------------------------------------------
  156.     function selectors passed to Socket Service entry point
  157. ------------------------------------------------------------------------------------------------------------------------------------------------
  158. */
  159.  
  160. enum {
  161.     fnSSGetAdapterCount            = 0x80,
  162.     fnSSUnsupported81            = 0x81,
  163.     fnSSUnsupported82            = 0x82,
  164.     fnSSGetSSInfo                = 0x83,
  165.     fnSSInquireAdapter            = 0x84,
  166.     fnSSGetAdapter                = 0x85,
  167.     fnSSSetAdapter                = 0x86,
  168.     fnSSInquireWindow            = 0x87,
  169.     fnSSGetWindow                = 0x88,
  170.     fnSSSetWindow                = 0x89,
  171.     fnSSGetPage                    = 0x8A,
  172.     fnSSSetPage                    = 0x8B,
  173.     fnSSInquireSocket            = 0x8C,
  174.     fnSSGetSocket                = 0x8D,
  175.     fnSSSetSocket                = 0x8E,
  176.     fnSSGetStatus                = 0x8F,
  177.     fnSSResetSocket                = 0x90,
  178.     fnSSUnsupported91            = 0x91,
  179.     fnSSUnsupported92            = 0x92,
  180.     fnSSUnsupported93            = 0x93,
  181.     fnSSUnsupported94            = 0x94,
  182.     fnSSInquireEDC                = 0x95,
  183.     fnSSGetEDC                    = 0x96,
  184.     fnSSSetEDC                    = 0x97,
  185.     fnSSStartEDC                = 0x98,
  186.     fnSSPauseEDC                = 0x99,
  187.     fnSSResumeEDC                = 0x9A,
  188.     fnSSStopEDC                    = 0x9B,
  189.     fnSSReadEDC                    = 0x9C,
  190.     fnSSGetVendorInfo            = 0x9D,
  191.     fnSSAcknowledgeInterrupt    = 0x9E,
  192.     fnSSGetSetPriorHandler        = 0x9F,
  193.     fnSSGetSetSSAddr            = 0xA0,
  194.     fnSSGetAccessOffsets        = 0xA1,
  195.     fnSSUnsupportedA2            = 0xA2,
  196.     fnSSUnsupportedA3            = 0xA3,
  197.     fnSSUnsupportedA4            = 0xA4,
  198.     fnSSUnsupportedA5            = 0xA5,
  199.     fnSSUnsupportedA6            = 0xA6,
  200.     fnSSUnsupportedA7            = 0xA7,
  201.     fnSSUnsupportedA8            = 0xA8,
  202.     fnSSUnsupportedA9            = 0xA9,
  203.     fnSSUnsupportedAA            = 0xAA,
  204.     fnSSUnsupportedAB            = 0xAB,
  205.     fnSSUnsupportedAC            = 0xAC,
  206.     fnSSUnsupportedAD            = 0xAD,
  207.     fnSSVendorSpecific            = 0xAE
  208. };
  209.  
  210. /*    SSVendorSpecificPB.function values*/
  211.  
  212. enum {
  213.     fnVSReserved                = 0x00,
  214.     fnVSGetSocketLocationIcon    = 0x01,
  215.     fnVSGetSocketLocationText    = 0x02,
  216.     fnVSDoSocketLocalization    = 0x03,
  217.     fnVSAppleSocketCapabilities    = 0x04,
  218.     fnVSSleepWakeNotification    = 0x05
  219. };
  220.  
  221. /*
  222. ------------------------------------------------------------------------------------------------------------------------------------------------
  223.     defines for the Socket Services function codes
  224. ------------------------------------------------------------------------------------------------------------------------------------------------
  225. */
  226.  
  227. enum {
  228.     AC_IND                        = 1,                            /* adapter characteristics*/
  229.     AC_PWR                        = 2,
  230.     AC_DBW                        = 4
  231. };
  232.  
  233.  
  234. enum {
  235.     AS_POWERDOWN                = 1,
  236.     AS_MAINTAIN                    = 2
  237. };
  238.  
  239.  
  240. enum {
  241.     EC_UNI                        = 1,
  242.     EC_BI                        = 2,
  243.     EC_REGISTER                    = 4,
  244.     EC_MEMORY                    = 8,
  245.     EC_PAUSABLE                    = 16,
  246.     EC_WRITE                    = 16
  247. };
  248.  
  249.  
  250. enum {
  251.     ET_CHECK8                    = 1,
  252.     ET_SDLC16                    = 2
  253. };
  254.  
  255.  
  256. enum {
  257.     IF_MEMORY                    = 1,
  258.     IF_IO                        = 2
  259. };
  260.  
  261.  
  262. enum {
  263.     IRQ_HIGH                    = 64,
  264.     IRQ_ENABLE                    = 128
  265. };
  266.  
  267.  
  268. enum {
  269.     IRQ_MEMORY                    = 4,
  270.     IRQ_IO                        = 4
  271. };
  272.  
  273.  
  274. enum {
  275.     PS_ATTRIBUTE                = 0x01,
  276.     PS_ENABLED                    = 0x02,
  277.     PS_WP                        = 0x04
  278. };
  279.  
  280.  
  281. enum {
  282.     PWR_VCC                        = 128,                            /* Power pins in PwrEntry elements*/
  283.     PWR_VPP1                    = 64,
  284.     PWR_VPP2                    = 32
  285. };
  286.  
  287.  
  288. enum {
  289.     SBM_WP                        = 1,
  290.     SBM_LOCKED                    = 2,
  291.     SBM_EJECT                    = 4,
  292.     SBM_INSERT                    = 8,
  293.     SBM_BVD1                    = 16,
  294.     SBM_BVD2                    = 32,
  295.     SBM_RDYBSY                    = 64,
  296.     SBM_CD                        = 128
  297. };
  298.  
  299.  
  300. enum {
  301.     SBM_LOCK                    = 16,
  302.     SBM_BATT                    = 32,
  303.     SBM_BUSY                    = 64,
  304.     SBM_XIP                        = 128
  305. };
  306.  
  307. /* Vendor Specific Apple Socket Capabilities */
  308.  
  309. enum {
  310.     SBM_SLEEP_PWR                = 1
  311. };
  312.  
  313.  
  314. enum {
  315.     WC_COMMON                    = 1,
  316.     WC_IO                        = 2,
  317.     WC_ATTRIBUTE                = 4,
  318.     WC_TYPE_MASK                = 7,
  319.     WC_WAIT                        = 128
  320. };
  321.  
  322.  
  323. enum {
  324.     WC_BASE                        = 1,
  325.     WC_SIZE                        = 2,
  326.     WC_WENABLE                    = 4,
  327.     WC_8BIT                        = 8,
  328.     WC_16BIT                    = 16,
  329.     WC_BALIGN                    = 32,
  330.     WC_POW2                        = 64,
  331.     WC_CALIGN                    = 128,
  332.     WC_PAVAIL                    = 256,
  333.     WC_PSHARED                    = 512,
  334.     WC_PENABLE                    = 1024,
  335.     WC_WP                        = 2048
  336. };
  337.  
  338.  
  339. enum {
  340.     WC_INPACK                    = 128,
  341.     WC_EISA                        = 256,
  342.     WC_CENABLE                    = 512
  343. };
  344.  
  345.  
  346. enum {
  347.     WS_IO                        = 1,
  348.     WS_ENABLED                    = 2,
  349.     WS_16BIT                    = 4
  350. };
  351.  
  352.  
  353. enum {
  354.     WS_PAGED                    = 8,
  355.     WS_EISA                        = 16,
  356.     WS_CENABLE                    = 32,
  357.     WS_SWAP_LITTLE_TO_BIG_ENDIAN = 64
  358. };
  359.  
  360.  
  361. enum {
  362.     SS_SIG_VALUE                = 0x5353                        /* 'SS'*/
  363. };
  364.  
  365.  
  366. enum {
  367.     SS_CMPL_1_00                = 0x0100,                        /* compliant with rev 1.0 of SS standard*/
  368.     SS_CMPL_1_01                = 0x0101,                        /* compliant with rev 1.01 of SS standard*/
  369.     SS_CMPL_2_00                = 0x0200,                        /* compliant with rev 2.0 of SS standard*/
  370.     SS_CMPL_2_10                = 0x0210                        /* compliant with rev 2.1 of SS standard*/
  371. };
  372.  
  373. /*
  374. ------------------------------------------------------------------------------------------------------------------------------------------------
  375.     Universal ProcPtr for Socket Service entry point
  376. ------------------------------------------------------------------------------------------------------------------------------------------------
  377. */
  378. typedef pascal short (*PCCardSSEntryProcPtr)(UInt16 fnCode, Ptr callPB, Ptr dataPtr);
  379.  
  380. #if GENERATINGCFM
  381. typedef UniversalProcPtr PCCardSSEntryUPP;
  382. #else
  383. typedef PCCardSSEntryProcPtr PCCardSSEntryUPP;
  384. #endif
  385.  
  386. enum {
  387.     uppPCCardSSEntryProcInfo = kPascalStackBased
  388.          | RESULT_SIZE(SIZE_CODE(sizeof(short)))
  389.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(UInt16)))
  390.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Ptr)))
  391.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Ptr)))
  392. };
  393.  
  394. #if GENERATINGCFM
  395. #define NewPCCardSSEntryProc(userRoutine)        \
  396.         (PCCardSSEntryUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppPCCardSSEntryProcInfo, GetCurrentArchitecture())
  397. #else
  398. #define NewPCCardSSEntryProc(userRoutine)        \
  399.         ((PCCardSSEntryUPP) (userRoutine))
  400. #endif
  401.  
  402. #if GENERATINGCFM
  403. #define CallPCCardSSEntryProc(userRoutine, fnCode, callPB, dataPtr)        \
  404.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppPCCardSSEntryProcInfo, (fnCode), (callPB), (dataPtr))
  405. #else
  406. #define CallPCCardSSEntryProc(userRoutine, fnCode, callPB, dataPtr)        \
  407.         (*(userRoutine))((fnCode), (callPB), (dataPtr))
  408. #endif
  409. /*
  410. ------------------------------------------------------------------------------------------------------------------------------------------------
  411.     Card Services calls used by a Socket Service
  412. ------------------------------------------------------------------------------------------------------------------------------------------------
  413. */
  414. struct CSEventEntryPB {
  415.     UInt32                             ssHandlerID;
  416.     UInt16                             adapter;
  417.     UInt16                             socket;
  418.     UInt16                             message;
  419.     Byte                             intrpBits;
  420.     Byte                             padding;
  421. };
  422. typedef struct CSEventEntryPB CSEventEntryPB;
  423.  
  424. typedef pascal void (*PCCardCSEntryProcPtr)(CSEventEntryPB *pb);
  425.  
  426. #if GENERATINGCFM
  427. typedef UniversalProcPtr PCCardCSEntryUPP;
  428. #else
  429. typedef PCCardCSEntryProcPtr PCCardCSEntryUPP;
  430. #endif
  431.  
  432. enum {
  433.     uppPCCardCSEntryProcInfo = kPascalStackBased
  434.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(CSEventEntryPB *)))
  435. };
  436.  
  437. #if GENERATINGCFM
  438. #define NewPCCardCSEntryProc(userRoutine)        \
  439.         (PCCardCSEntryUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppPCCardCSEntryProcInfo, GetCurrentArchitecture())
  440. #else
  441. #define NewPCCardCSEntryProc(userRoutine)        \
  442.         ((PCCardCSEntryUPP) (userRoutine))
  443. #endif
  444.  
  445. #if GENERATINGCFM
  446. #define CallPCCardCSEntryProc(userRoutine, pb)        \
  447.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppPCCardCSEntryProcInfo, (pb))
  448. #else
  449. #define CallPCCardCSEntryProc(userRoutine, pb)        \
  450.         (*(userRoutine))((pb))
  451. #endif
  452. /*------------        AddSocketServices        ------------                            */
  453. struct AddSocketServicesPB {
  454.     PCCardSSEntryUPP                 ssEntry;                    /* -> given to CS for its use*/
  455.     PCCardCSEntryUPP                 csEntry;                    /* <- taken from CS so we know where to enter*/
  456.  
  457.     UInt32                             dataPtr;
  458.     UInt32                             attributes;
  459.     UInt16                             numAdapters;
  460.     UInt16                             numSockets;
  461. };
  462. typedef struct AddSocketServicesPB AddSocketServicesPB;
  463.  
  464. /*------------         ReplaceSocketServices    ------------                            */
  465. struct ReplaceSocketServicesPB {
  466.     PCCardSSEntryUPP                 ssEntry;
  467.     PCCardSSEntryUPP                 oldSSEntry;
  468.  
  469.     UInt32                             dataPtr;
  470.     UInt16                             socket;
  471.     UInt16                             numSockets;
  472.     UInt16                             attributes;
  473. };
  474. typedef struct ReplaceSocketServicesPB ReplaceSocketServicesPB;
  475.  
  476. extern pascal OSErr CSAddSocketServices(AddSocketServicesPB *pb)
  477.  TWOWORDINLINE(0x7050, 0xAAF0);
  478.  
  479. extern pascal OSErr CSReplaceSocketServices(ReplaceSocketServicesPB *pb)
  480.  TWOWORDINLINE(0x7051, 0xAAF0);
  481.  
  482. /*
  483. ------------------------------------------------------------------------------------------------------------------------------------------------
  484.     parameter blocks for each Socket Service function
  485. ------------------------------------------------------------------------------------------------------------------------------------------------
  486. */
  487. struct SSAcknowledgeInterruptPB {
  488.     UInt16                             adapter;                    /*    SS_ADAPTER*/
  489.     UInt16                             sockets;                    /*    SS_SKTBITS*/
  490. };
  491. typedef struct SSAcknowledgeInterruptPB SSAcknowledgeInterruptPB;
  492.  
  493. struct SSGetAccessOffsetsPB {
  494.     UInt16                             adapter;                    /*    SS_ADAPTER*/
  495.     Byte                             mode;                        /*    SS_BYTE*/
  496.     Byte                             reserved;                    /*    padding*/
  497.     UInt16                             count;                        /*    SS_COUNT*/
  498.     Ptr                             buffer;                        /*    SS_PTR*/
  499.     UInt16                             numAvail;                    /*    SS_COUNT*/
  500. };
  501. typedef struct SSGetAccessOffsetsPB SSGetAccessOffsetsPB;
  502.  
  503. struct SSGetAdapterCountPB {
  504.     UInt16                             totalAdapters;                /*    SS_COUNT*/
  505.     UInt16                             sig;                        /*    SS_SIGNATURE*/
  506. };
  507. typedef struct SSGetAdapterCountPB SSGetAdapterCountPB;
  508.  
  509. struct SSGetSetAdapterPB {
  510.     UInt16                             adapter;                    /*    SS_ADAPTER*/
  511.     Byte                             state;                        /*    SS_FLAGS8*/
  512.     Byte                             irqStatus;                    /*    SS_IRQ*/
  513. };
  514. typedef struct SSGetSetAdapterPB SSGetSetAdapterPB;
  515.  
  516. struct SSGetSetEDCPB {
  517.     UInt16                             adapter;                    /*    SS_ADAPTER*/
  518.     UInt16                             edc;                        /*    SS_EDC*/
  519.     UInt16                             socket;                        /*    SS_SOCKET*/
  520.     Byte                             state;                        /*    SS_FLAGS8*/
  521.     Byte                             edcType;                    /*    SS_FLAGS8*/
  522. };
  523. typedef struct SSGetSetEDCPB SSGetSetEDCPB;
  524.  
  525. struct SSGetSetPagePB {
  526.     UInt16                             adapter;                    /*    SS_ADAPTER*/
  527.     UInt16                             window;                        /*    SS_WINDOW*/
  528.     UInt16                             page;                        /*    SS_PAGE*/
  529.     Byte                             state;                        /*    SS_FLAGS8*/
  530.     Byte                             reserved;                    /*    padding*/
  531.     UInt32                             offset;                        /*    SS_OFFSET*/
  532. };
  533. typedef struct SSGetSetPagePB SSGetSetPagePB;
  534.  
  535. struct SSGetSetPriorHandlerPB {
  536.     UInt16                             adapter;                    /*    SS_ADAPTER*/
  537.     Byte                             mode;                        /*    SS_FLAGS8*/
  538.     Byte                             reserved;                    /*    padding*/
  539.     Ptr                             handler;                    /*    SS_PTR*/
  540. };
  541. typedef struct SSGetSetPriorHandlerPB SSGetSetPriorHandlerPB;
  542.  
  543. struct SSGetSetSocketPB {
  544.     UInt16                             adapter;                    /*    SS_ADAPTER*/
  545.     UInt16                             socket;                        /*    SS_SOCKET*/
  546.     UInt16                             vccIndex;                    /*    SS_PWRINDEX*/
  547.     UInt16                             vpp1Index;                    /*    SS_PWRINDEX*/
  548.     UInt16                             vpp2Index;                    /*    SS_PWRINDEX*/
  549.     Byte                             scIntMask;                    /*    SS_FLAGS8*/
  550.     Byte                             state;                        /*    SS_FLAGS8*/
  551.     Byte                             ctlInd;                        /*    SS_FLAGS8*/
  552.     Byte                             ireqRouting;                /*    SS_IRQ*/
  553.     Byte                             ifType;                        /*    SS_FLAGS8*/
  554.     Byte                             padding[1];                    /*    */
  555. };
  556. typedef struct SSGetSetSocketPB SSGetSetSocketPB;
  557.  
  558. struct SSGetSetSSAddrPB {
  559.     UInt16                             adapter;                    /*    SS_ADAPTER*/
  560.     Byte                             mode;                        /*    SS_BYTE*/
  561.     Byte                             subfunc;                    /*    SS_BYTE*/
  562.     UInt16                             numAddData;                    /*    SS_COUNT*/
  563.     Ptr                             buffer;                        /*    SS_PTR*/
  564. };
  565. typedef struct SSGetSetSSAddrPB SSGetSetSSAddrPB;
  566.  
  567. struct SSGetSetWindowPB {
  568.     UInt16                             adapter;                    /*    SS_ADAPTER*/
  569.     UInt16                             window;                        /*    SS_WINDOW*/
  570.     UInt16                             socket;                        /*    SS_SOCKET*/
  571.     UInt32                             size;                        /*    SS_SIZE*/
  572.     Byte                             state;                        /*    SS_FLAGS8*/
  573.     Byte                             reserved;                    /*    padding*/
  574.     UInt16                             speed;                        /*    SS_SPEED*/
  575.     UInt32                             base;                        /*    SS_BASE*/
  576. };
  577. typedef struct SSGetSetWindowPB SSGetSetWindowPB;
  578.  
  579. struct SSGetSSInfoPB {
  580.     UInt16                             adapter;                    /*    SS_ADAPTER*/
  581.     UInt16                             compliance;                    /*    SS_BCD*/
  582.     UInt16                             numAdapters;                /*    SS_COUNT*/
  583.     UInt16                             firstAdapter;                /*    SS_ADAPTER*/
  584. };
  585. typedef struct SSGetSSInfoPB SSGetSSInfoPB;
  586.  
  587. struct SSGetStatusPB {
  588.     UInt16                             adapter;                    /*    SS_ADAPTER*/
  589.     UInt16                             socket;                        /*    SS_SOCKET*/
  590.     Byte                             cardState;                    /*    SS_FLAGS8*/
  591.     Byte                             socketState;                /*    SS_FLAGS8*/
  592.     Byte                             ctlInd;                        /*    SS_FLAGS8*/
  593.     Byte                             ireqRouting;                /*    SS_IRQ*/
  594.     Byte                             ifType;                        /*    SS_FLAGS8*/
  595.     Byte                             padding[1];                    /*    */
  596. };
  597. typedef struct SSGetStatusPB SSGetStatusPB;
  598.  
  599. struct SSGetVendorInfoPB {
  600.     UInt16                             adapter;                    /*    SS_ADAPTER*/
  601.     Byte                             vendorInfoType;                /*    SS_BYTE*/
  602.     Byte                             reserved;                    /*    padding*/
  603.     Ptr                             buffer;                        /*    SS_PTR*/
  604.     UInt16                             release;                    /*    SS_BCD*/
  605. };
  606. typedef struct SSGetVendorInfoPB SSGetVendorInfoPB;
  607.  
  608. struct SSInquireAdapterPB {
  609.     UInt16                             adapter;                    /*    SS_ADAPTER*/
  610.     Ptr                             buffer;                        /*    SS_PTR*/
  611.     UInt16                             numSockets;                    /*    SS_COUNT*/
  612.     UInt16                             numWindows;                    /*    SS_COUNT*/
  613.     UInt16                             numEDCs;                    /*    SS_COUNT*/
  614. };
  615. typedef struct SSInquireAdapterPB SSInquireAdapterPB;
  616.  
  617. struct SSInquireEDCPB {
  618.     UInt16                             adapter;                    /*    SS_ADAPTER*/
  619.     UInt16                             edc;                        /*    SS_EDC*/
  620.     UInt16                             sockets;                    /*    SS_SKTBITS*/
  621.     Byte                             caps;                        /*    SS_FLAGS8*/
  622.     Byte                             types;                        /*    SS_FLAGS8*/
  623. };
  624. typedef struct SSInquireEDCPB SSInquireEDCPB;
  625.  
  626. struct SSInquireSocketPB {
  627.     UInt16                             adapter;                    /*    SS_ADAPTER*/
  628.     UInt16                             socket;                        /*    SS_SOCKET*/
  629.     Ptr                             buffer;                        /*    SS_PTR*/
  630.     Byte                             scIntCaps;                    /*    SS_FLAGS8*/
  631.     Byte                             scRptCaps;                    /*    SS_FLAGS8*/
  632.     Byte                             ctlIndCaps;                    /*    SS_FLAGS8*/
  633.     Byte                             padding[1];                    /*    */
  634. };
  635. typedef struct SSInquireSocketPB SSInquireSocketPB;
  636.  
  637. struct SSInquireWindowPB {
  638.     UInt16                             adapter;                    /*    SS_ADAPTER*/
  639.     UInt16                             window;                        /*    SS_WINDOW*/
  640.     Ptr                             buffer;                        /*    SS_PTR*/
  641.     Byte                             wndCaps;                    /*    SS_FLAGS8*/
  642.     Byte                             reserved;                    /*    padding*/
  643.     UInt16                             sockets;                    /*    SS_SKTBITS*/
  644. };
  645. typedef struct SSInquireWindowPB SSInquireWindowPB;
  646.  
  647. struct SSPauseEDCPB {
  648.     UInt16                             adapter;                    /*    SS_ADAPTER*/
  649.     UInt16                             edc;                        /*    SS_EDC*/
  650. };
  651. typedef struct SSPauseEDCPB SSPauseEDCPB;
  652.  
  653. struct SSReadEDCPB {
  654.     UInt16                             adapter;                    /*    SS_ADAPTER*/
  655.     UInt16                             edc;                        /*    SS_EDC*/
  656.     UInt16                             value;                        /*    SS_WORD*/
  657. };
  658. typedef struct SSReadEDCPB SSReadEDCPB;
  659.  
  660. struct SSResetSocketPB {
  661.     UInt16                             adapter;                    /*    SS_ADAPTER*/
  662.     UInt16                             socket;                        /*    SS_SOCKET*/
  663. };
  664. typedef struct SSResetSocketPB SSResetSocketPB;
  665.  
  666. struct SSResumeEDCPB {
  667.     UInt16                             adapter;                    /*    SS_ADAPTER*/
  668.     UInt16                             edc;                        /*    SS_EDC*/
  669. };
  670. typedef struct SSResumeEDCPB SSResumeEDCPB;
  671.  
  672. struct SSStartEDCPB {
  673.     UInt16                             adapter;                    /*    SS_ADAPTER*/
  674.     UInt16                             edc;                        /*    SS_EDC*/
  675. };
  676. typedef struct SSStartEDCPB SSStartEDCPB;
  677.  
  678. struct SSStopEDCPB {
  679.     UInt16                             adapter;                    /*    SS_ADAPTER*/
  680.     UInt16                             edc;                        /*    SS_EDC*/
  681. };
  682. typedef struct SSStopEDCPB SSStopEDCPB;
  683.  
  684. struct SSVendorSpecificPB {
  685.     UInt16                             vsFunction;                    /*    SS_WORD*/
  686.     UInt16                             adapter;                    /*    SS_ADAPTER*/
  687.     UInt16                             socket;                        /*    SS_SOCKET*/
  688.     UInt16                             bufferSize;                    /*    SS_WORD*/
  689.     Ptr                             buffer;                        /*    SS_PTR*/
  690.     UInt32                             attributes;                    /*    SS_LONG*/
  691. };
  692. typedef struct SSVendorSpecificPB SSVendorSpecificPB;
  693.  
  694. /*    `attributes' constants */
  695.  
  696. enum {
  697.     kSSGoingToSleep                = 0x00000001,
  698.     kSSWakingFromSleep            = 0x00000002
  699. };
  700.  
  701. /*
  702. ------------------------------------------------------------------------------------------------------------------------------------------------
  703.     Non-specific Socket Services Functions
  704. ------------------------------------------------------------------------------------------------------------------------------------------------
  705. */
  706. extern pascal SS_RETCODE SSGetAdapterCount(SSGetAdapterCountPB *pb, Ptr dataPtr);
  707.  
  708. /*
  709. ------------------------------------------------------------------------------------------------------------------------------------------------
  710.     Adapter Functions
  711. ------------------------------------------------------------------------------------------------------------------------------------------------
  712. */
  713. extern pascal SS_RETCODE SSAcknowledgeInterrupt(SSAcknowledgeInterruptPB *pb, Ptr dataPtr);
  714.  
  715. extern pascal SS_RETCODE SSGetSetPriorHandler(SSGetSetPriorHandlerPB *pb, Ptr dataPtr);
  716.  
  717. extern pascal SS_RETCODE SSGetSetSSAddr(SSGetSetSSAddrPB *pb, Ptr dataPtr);
  718.  
  719. extern pascal SS_RETCODE SSGetAccessOffsets(SSGetAccessOffsetsPB *pb, Ptr dataPtr);
  720.  
  721. extern pascal SS_RETCODE SSGetAdapter(SSGetSetAdapterPB *pb, Ptr dataPtr);
  722.  
  723. extern pascal SS_RETCODE SSGetSSInfo(SSGetSSInfoPB *pb, Ptr dataPtr);
  724.  
  725. extern pascal SS_RETCODE SSGetVendorInfo(SSGetVendorInfoPB *pb, Ptr dataPtr);
  726.  
  727. extern pascal SS_RETCODE SSInquireAdapter(SSInquireAdapterPB *pb, Ptr dataPtr);
  728.  
  729. extern pascal SS_RETCODE SSSetAdapter(SSGetSetAdapterPB *pb, Ptr dataPtr);
  730.  
  731. extern pascal SS_RETCODE SSVendorSpecific(SSVendorSpecificPB *pb, Ptr dataPtr);
  732.  
  733. /*
  734. ------------------------------------------------------------------------------------------------------------------------------------------------
  735.     Socket Functions
  736. ------------------------------------------------------------------------------------------------------------------------------------------------
  737. */
  738. extern pascal SS_RETCODE SSGetSocket(SSGetSetSocketPB *pb, Ptr dataPtr);
  739.  
  740. extern pascal SS_RETCODE SSGetStatus(SSGetStatusPB *pb, Ptr dataPtr);
  741.  
  742. extern pascal SS_RETCODE SSInquireSocket(SSInquireSocketPB *pb, Ptr dataPtr);
  743.  
  744. extern pascal SS_RETCODE SSResetSocket(SSResetSocketPB *pb, Ptr dataPtr);
  745.  
  746. extern pascal SS_RETCODE SSSetSocket(SSGetSetSocketPB *pb, Ptr dataPtr);
  747.  
  748. /*
  749. ------------------------------------------------------------------------------------------------------------------------------------------------
  750.     Window Functions
  751. ------------------------------------------------------------------------------------------------------------------------------------------------
  752. */
  753. extern pascal SS_RETCODE SSGetPage(SSGetSetPagePB *pb, Ptr dataPtr);
  754.  
  755. extern pascal SS_RETCODE SSGetWindow(SSGetSetWindowPB *pb, Ptr dataPtr);
  756.  
  757. extern pascal SS_RETCODE SSInquireWindow(SSInquireWindowPB *pb, Ptr dataPtr);
  758.  
  759. extern pascal SS_RETCODE SSSetPage(SSGetSetPagePB *pb, Ptr dataPtr);
  760.  
  761. extern pascal SS_RETCODE SSSetWindow(SSGetSetWindowPB *pb, Ptr dataPtr);
  762.  
  763. /*
  764. ------------------------------------------------------------------------------------------------------------------------------------------------
  765.     Error Detection Functions
  766. ------------------------------------------------------------------------------------------------------------------------------------------------
  767. */
  768. extern pascal SS_RETCODE SSGetEDC(SSGetSetEDCPB *pb, Ptr dataPtr);
  769.  
  770. extern pascal SS_RETCODE SSInquireEDC(SSInquireEDCPB *pb, Ptr dataPtr);
  771.  
  772. extern pascal SS_RETCODE SSPauseEDC(SSPauseEDCPB *pb, Ptr dataPtr);
  773.  
  774. extern pascal SS_RETCODE SSReadEDC(SSReadEDCPB *pb, Ptr dataPtr);
  775.  
  776. extern pascal SS_RETCODE SSResumeEDC(SSResumeEDCPB *pb, Ptr dataPtr);
  777.  
  778. extern pascal SS_RETCODE SSSetEDC(SSGetSetEDCPB *pb, Ptr dataPtr);
  779.  
  780. extern pascal SS_RETCODE SSStartEDC(SSStartEDCPB *pb, Ptr dataPtr);
  781.  
  782. extern pascal SS_RETCODE SSStopEDC(SSStopEDCPB *pb, Ptr dataPtr);
  783.  
  784. #endif
  785.  
  786. #if PRAGMA_ALIGN_SUPPORTED
  787. #pragma options align=reset
  788. #endif
  789.  
  790. #if PRAGMA_IMPORT_SUPPORTED
  791. #pragma import off
  792. #endif
  793.  
  794. #ifdef __cplusplus
  795. }
  796. #endif
  797.  
  798. #endif /* __SOCKETSERVICES__ */
  799.  
  800.